{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="{% static 'app_02/plugins/bootstrap-3.4.1/css/bootstrap.min.css' %}">
    <style>
        .account {
            width: 500px;
            border: 1px solid #dddddd;
            height: 395px;
            margin-left: auto;
            margin-right: auto;
            margin-top: 200px;
            padding: 20px 40px;
            box-shadow: 5px 5px 20px #aaa;
        }

        .account h2 {
            margin-top: 10px;
            margin-bottom: 10px;
            text-align: center;
        }

        .btn-primary {
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="account">
    <!--  h1 块级标签-->
    <h2>用户登录</h2>
    <form method="post" action="{% url '2:a' %}" novalidate>
        {% csrf_token %}
        {% for field in form %}
        <div class="form-group">
            {% if field.label == "验证码" %}
                <label for="id_code">图片验证码</label>
                <div class="row">
                    <div class="col-xs-7">
                        <input type="text" name="code" class="form-control" placeholder="请入验证码" required="" id="id_code">
                        <span style="color: red;"></span>
                        <span style="color: red">{{ field.errors.0 }}</span>
                    </div>
                    <div class="col-xs-5">
                        <img id="isd_code" src="/app_02/image/code/">
                    </div>
                </div>
            {% else %}
                <label>{{ field.label }}</label>
                {{ field }}
                <span style="color: red">{{ field.errors.0 }}</span>   <!--[错误1， 错误2....]-->
                <!-- <input type="text" class="form-control" placeholder="标题" name="title"/>-->
            {% endif %}
        </div>
        {% endfor %}

        <input type="submit" class="btn btn-primary" value="登录">
    </form>
</div>
</body>
</html>


